package com.hqyj.lyf.controller;

import com.hqyj.lyf.service.impl.FileUploadService;
import com.hqyj.lyf.utils.ExcelUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;


import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;

/**
 * @author Qiuluoer
 * @date 2022/5/31 22:44
 */
@Controller
@RequestMapping("/")
public class FileUploadController {

    @Autowired
    private FileUploadService fileUploadService;
    @RequestMapping("/upload2")
    @ResponseBody
    public Map fileUpload2(@RequestParam("file") MultipartFile file) throws IOException {

        Map map = fileUploadService.addQuestions(file);
        return map;
    }

}
